package com.qfedu.springmvc.controller;

import com.qfedu.springmvc.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/json")
public class JsonController {


    @RequestMapping(value = "/test1",produces = "text/html;charset=utf-8")
    public String test1(){
        return "ok,中文";
    }


    @RequestMapping(value = "/test2")
    public User test2(){
        User user = new User();
        user.setId(1);
        user.setName("王");
        return user;
    }
}
